package com.bdqn.t350.proxy;

import java.lang.reflect.Proxy;

/**
 * 创建代理对象
 */
public class IntermediaryProxyFactory {

    public static <T> T create(Object target) {
        IntermediaryImp intermediaryImp = new IntermediaryImp(target);
        return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(),
                target.getClass().getInterfaces(),
                intermediaryImp);
    }
}
